package gui.event.manhinhchinh;

import gui.benhan.BAMainPanel;
import gui.benhan.BASuaThongTin_Full;
import gui.benhan.BATao_Full;
import gui.benhan.BATimKiem_Dialog;
import gui.benhan.BAXoa_Full;
import gui.event.ulti.Util;
import gui.khachhang.KHMainPanel;
import javax.swing.JTabbedPane;
import gui.khachhang.KHPhucHoi_Full;
import gui.khachhang.KHSaoLuu_Full;
import gui.khachhang.KHSuaThongTin_Full;
import gui.khachhang.KHThem_Full;
import gui.khachhang.KHTimKiem_Dialog;
import gui.thuoc.ThuocCapNhat_Full;
import gui.thuoc.ThuocMainPanel;
import gui.thuoc.ThuocThem_Full;
import gui.thuoc.ThuocTimKiem_Dialog;
import gui.thuoc.ThuocXoa_Full;
import gui.vatnuoi.VNHuy_Dialog;
import gui.vatnuoi.VNMainPanel;
import gui.vatnuoi.VNSuaThongTin_Full;
import gui.vatnuoi.VNThem_Full;
import gui.vatnuoi.VNTimKiem_Full;
import gui.tiemchung.TCMainPanel;
import gui.tiemchung.TCSuaThongTinHoSo_Full;
import gui.tiemchung.TCThemHoSo_Full;
import gui.tiemchung.TCTimKiemHoSo_Dialog;
import gui.tiemchung.TCXoa_Full;
import javax.swing.JFrame;
import javax.swing.JTable;
import gui.benhan.BASuaThongTin_Dialog;
import gui.benhan.BAXoa_Dialog;
import gui.khachhang.KHSuaThongTin_Dialog;

/**
 *
 * @author nv_ca@live.com
 */
public class MainFrame_evt {

    // <editor-fold defaultstate="collapsed" desc="Event ở ToolBar">
    public static final void toolbarThemKhachHang(JFrame frame) {
        KHThem_Full khThemFull = new KHThem_Full(tableKhachHang, frame, true);
        khThemFull.setVisible(true);
    }

    public static final void toolbarThemVatNuoi(JFrame frame) {
        VNThem_Full vnThemFull = new VNThem_Full(frame, true);
        vnThemFull.setVisible(true);
    }

    public static final void toolbarCapNhatThuoc(JFrame frame) {
        ThuocCapNhat_Full thuocCapNhat_Full = new ThuocCapNhat_Full(frame, true);
        thuocCapNhat_Full.setVisible(true);
    }

    public static final void toolbarThemBenhAn(JFrame frame) {
        BATao_Full baTaoFull = new BATao_Full(tableBenhAn, frame, true);
        baTaoFull.setVisible(true);
    }

    public static void toolbarThemHoSoTiemChung(JFrame frame) {
        miThemHoSoTiemChung(frame);
    }

    // </editor-fold>
    // <editor-fold defaultstate="collapsed" desc="Khách Hàng">
    private static JTable tableKhachHang;

    public static final void miQuanLyKhachHang(JTabbedPane jTabbedPane) {
        String panelName = "Quản Lý Khách Hàng";
        KHMainPanel panelKH = new KHMainPanel();
        tableKhachHang = panelKH.getBtlKhachHang();
        Util.addTab(panelName, jTabbedPane, panelKH);
    }

    public static final void miSuaThongTinKhachHang(JFrame frame) {
        KHSuaThongTin_Full khSuaFull = new KHSuaThongTin_Full(frame, true);
        KHSuaThongTin_Dialog kHSuaThongTin_Dialog = new KHSuaThongTin_Dialog(tableKhachHang, frame, true);
        khSuaFull.setVisible(true);
    }

    public static final void miThemKhachHangMoi(JFrame frame) {
        KHThem_Full khThemFull = new KHThem_Full(tableKhachHang, frame, true);
        khThemFull.setVisible(true);
    }

    public static final void miSaoLuuKhachHang(JFrame frame) {
        KHSaoLuu_Full khSaoLuuFull = new KHSaoLuu_Full(frame, true);
        khSaoLuuFull.setVisible(true);
    }

    public static final void miPhucHoiKhachHang(JFrame frame) {
        KHPhucHoi_Full khPhucHoiFull = new KHPhucHoi_Full(frame, true);
        khPhucHoiFull.setVisible(true);
    }

    public static final void miTimKiemKhachHang(JFrame frame) {
        KHTimKiem_Dialog khTimKiemDlg = new KHTimKiem_Dialog(frame, true);
        khTimKiemDlg.setVisible(true);
    }

    // </editor-fold>
    // <editor-fold defaultstate="collapsed" desc="Thuốc">
    public static final void miQuanLyThuoc(JTabbedPane jTabbedPane) {
        String panelName = "Quản Lý Thuốc";
        Util.addTab(panelName, jTabbedPane, new ThuocMainPanel());
    }

    public static final void miCapNhatThuoc(JFrame frame) {
        ThuocCapNhat_Full thuocCapNhat_Full = new ThuocCapNhat_Full(frame, true);
        thuocCapNhat_Full.setVisible(true);
    }

    public static final void miThemThuoc(JFrame frame) {
        ThuocThem_Full thuocThem_Full = new ThuocThem_Full(frame, true);
        thuocThem_Full.setVisible(true);
    }

    public static final void miXoaThuoc(JFrame frame) {
        ThuocXoa_Full thuocXoa_Full = new ThuocXoa_Full(frame, true);
        thuocXoa_Full.setVisible(true);
    }

    public static final void miTimKiemThuoc(JFrame frame) {
        ThuocTimKiem_Dialog thuocTimKiem_Dialog = new ThuocTimKiem_Dialog(frame, true);
        thuocTimKiem_Dialog.setVisible(true);
    }

    // </editor-fold>
    // <editor-fold defaultstate="collapsed" desc="Vật Nuôi">
    public static final void miQuanLyVN(JTabbedPane jTabbedPane) {
        String panelName = "Quản Lý Vật Nuôi";
        Util.addTab(panelName, jTabbedPane, new VNMainPanel());
    }

    public static final void miSuaVN(JFrame frame) {
        VNSuaThongTin_Full vNSuaThongTin_Full = new VNSuaThongTin_Full(frame, true);
        vNSuaThongTin_Full.setVisible(true);
    }

    public static final void miThemVN(JFrame frame) {
        VNThem_Full vNThem_Full = new VNThem_Full(frame, true);
        vNThem_Full.setVisible(true);
    }

    public static final void miHuyVN(JFrame frame) {
        VNHuy_Dialog vNHuy_Full = new VNHuy_Dialog(frame, true);
        vNHuy_Full.setVisible(true);
    }

    public static final void miTimKiemVN(JFrame frame) {
        VNTimKiem_Full vNTimKiem_Full = new VNTimKiem_Full(frame, true);
        vNTimKiem_Full.setVisible(true);
    }

    // </editor-fold>
    // <editor-fold defaultstate="collapsed" desc="Bệnh Án">
    private static JTable tableBenhAn;

    public static final void miQuanLyBenhAn(JTabbedPane jTabbedPane) {
        String panelName = "Quản Lý Bệnh Án";
        BAMainPanel benhAn = new BAMainPanel();
        tableBenhAn = benhAn.getBtlHSBA();
        Util.addTab(panelName, jTabbedPane, benhAn);
    }

    public static final void miSuaThongTinBenhAn(JFrame frame) {
        BASuaThongTin_Full baSuaFull = new BASuaThongTin_Full(frame, true);
        BASuaThongTin_Dialog baSuaDialog = new BASuaThongTin_Dialog(tableBenhAn, frame, true);
        baSuaFull.setVisible(true);
    }

    public static final void miTaoBenhAnMoi(JFrame frame) {
        BATao_Full baTaoDlg = new BATao_Full(tableBenhAn, frame, true);
        baTaoDlg.setVisible(true);
    }

    public static final void miXoaBenhAn(JFrame frame) {
        BAXoa_Full baXoaFull = new BAXoa_Full(frame, true);
        baXoaFull.setVisible(true);
    }

    public static final void miTimKiemBenhAn(JFrame frame) {
        BATimKiem_Dialog baTimKiemDlg = new BATimKiem_Dialog(frame, true);
        BAXoa_Dialog bAXoa_Dialog = new BAXoa_Dialog(tableBenhAn, frame, true);
        baTimKiemDlg.setVisible(true);

    }

// </editor-fold>
    // <editor-fold defaultstate="collapsed" desc="Tiêm chủng">
    public static final void miQuanLyTiemChung(JTabbedPane jTabbedPane) {
        String panelName = "Quản Lý Tiêm Chủng";
        Util.addTab(panelName, jTabbedPane, new TCMainPanel());
    }

    public static final void miSuaHoSoTiemChung(JFrame frame) {
        TCSuaThongTinHoSo_Full khSuaFull = new TCSuaThongTinHoSo_Full(frame, true);
        khSuaFull.setVisible(true);
    }

    public static final void miThemHoSoTiemChung(JFrame frame) {
        TCThemHoSo_Full tcThemFull = new TCThemHoSo_Full(null, frame, true);
        tcThemFull.setVisible(true);
    }

    public static void miXoaHoSoTiemChung(JFrame frame) {
        TCXoa_Full tcXoaFull = new TCXoa_Full(frame, true);
        tcXoaFull.setVisible(true);
    }

    public static void miTimKiemHoSoTiemChung(JFrame frame) {
        TCTimKiemHoSo_Dialog tcTimKiemHoSo = new TCTimKiemHoSo_Dialog(frame, true);
        tcTimKiemHoSo.setVisible(true);
    }
// </editor-fold>

}
